
# Global Defines
ROOT_DIR = $(shell pwd)

include $(PROJECT_ROOT)/build/rules.mk


LIBNAME=test_cases.bin

# Target
TARGETS_bin = $(ROOT_DIR)/$(LIBNAME)
all:$(TARGETS_bin)

# SRCS
SRC_DIR := $(ROOT_DIR)/
OBJ_DIR := $(ROOT_DIR)/objs

SRCS := $(wildcard $(SRC_DIR)/*.c)
OBJS := $(addprefix $(OBJ_DIR)/, $(notdir $(patsubst %.c, %.o, $(SRCS))))
#SRCS	:=
#OBJS 	:= test_list.o	\
					main.o


# Defines
DEFINES +=	\
	-DDPL  
	
# Includes
INCLUDEDIRS = -I. \
			-I$(PROJECT_ROOT)/lib \
			
CFLAGS += $(DEFINES) $(INCLUDEDIRS)

# LDFlags
LDFLAGS = \
	-L$(PROJECT_ROOT)/lib	



# LIBS
LIBS = -ldpl -lpthread	-lrt

# Build application if specified, link this object with local libs
$(TARGETS_bin):  $(OBJS) $(CXXOBJS)
	$(E) "Creating application $(TARGETS_bin) ..."
	$(RM) $(TARGETS_bin) 
	$(CC) $(OBJS) $(LIBS) $(CXXOBJS) $(LDFLAGS) $(CFLAGS) -o $@


# Compilation target for C files
$(OBJ_DIR)/%.o:$(SRC_DIR)/%.c 
	$(E) "Compiling SRC$< ..."
	$(CC)  $(CFLAGS) -c -o $@ $<

clean:
	$(E) Cleaning $(TARGETS_bin)
	$(Q) $(RM) $(OBJS) $(patsubst %.o, %.d, $(OBJS)) $(TARGETS_bin)
